#include "launcher.h"
#include <QDesktopWidget>


Launcher::Launcher(QWidget *parent, Qt::WFlags flags)
	: QMainWindow(parent, flags)
{
	ui.setupUi(this);

	QRect winRect = rect();
	winRect.moveCenter( QDesktopWidget().availableGeometry().center() );
	move( winRect.topLeft() );
}

Launcher::~Launcher()
{

}

void Launcher::setDownloadProgress(qint64 bytesDownloaded, qint64 bytesTotal)
{
	int downloaded = bytesDownloaded;
	int total = bytesTotal;

	if (ui.progressBar->maximum() != total)
		ui.progressBar->setMaximum(total);
	ui.progressBar->setValue(downloaded);
}
